﻿Imports System.Data
Imports System.Data.SqlClient
Imports System.Text
Imports System.IO
Public Class actualiza_clientes

    Private Sub actualiza_clientes_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

   
    Private Sub BackgroundWorker1_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork


    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Me.Close()
    End Sub

    Private Sub Button3_Click_2(sender As Object, e As EventArgs) Handles Button3.Click
        Dim resp = MsgBox("¿ Desea actualizar la información de clientes ?", MsgBoxStyle.YesNo + MsgBoxStyle.Question)
        If resp = vbYes Then
            Dim SQL1 As String = "delete from Clientes"
            Conn.Open()
            Try
                Dim cdo As New SqlCommand(SQL1, Conn)
                cdo.ExecuteNonQuery()
            Catch ex As Exception
                MsgBox("Error Eliminando: " & ex.Message, MsgBoxStyle.Critical)
            End Try
            Conn.Close()

            Dim SQL2 As String = "select * from C2CLIEN order by Ruc asc"
            Dim da As SqlDataAdapter
            Dim dt As New DataTable
            Try
                da = New SqlDataAdapter(SQL2, nCnn1)
                da.Fill(dt)
                For i = 0 To dt.Rows.Count - 1
                    Dim SQL3 As String
                Next
            Catch ex As Exception
                MsgBox("Error buscando: " & ex.Message, MsgBoxStyle.Critical)
            End Try
        End If
    End Sub
End Class